<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:a4j="http://richfaces.org/a4j"
	template="/pages/templates/templateMain.xhtml">

	<ui:param name="browser_tab_title" value="Edit service" />
	<ui:param name="page_title"
		value="Add new service / Edit existing service" />

	<ui:define name="content">
		<p:panel id="panel">
			<h:form>
				<h:panelGrid columns="3">
					<h:outputLabel value="Name:" />
					<h:inputText id="serviceName" value="#{service.name}">
						<rich:ajaxValidator summary="Invalid service name" event="onblur" />
					</h:inputText>
					<rich:message for="serviceName" />

					<h:outputLabel value="Description:" />
					<h:inputText id="serviceDescription" value="#{service.description}">
						<rich:ajaxValidator summary="Invalid service description"
							event="onblur" />
					</h:inputText>
					<rich:message for="serviceDescription" />

					<h:outputLabel value="Target repository: " for="repositorySelector" />
					<h:selectOneMenu value="#{selectedRepository}" required="true"
						requiredMessage="Select repository" id="repositorySelector">
						<s:selectItems var="item" value="#{repositoryList}"
							label="#{item.name}" noSelectionLabel="Select repository"
							id="repositoryList" />
						<s:convertEntity />
					</h:selectOneMenu>
					<rich:message for="repositorySelector" />
				</h:panelGrid>

				<br />
				<br />

				<p:commandButton id="buttonCancel" value="Cancel" action="cancel"
					immediate="true" ajax="false" />

				<p:commandButton id="buttonNext" value="Edit bundles"
					action="#{editServiceBean.toEditBundles}" ajax="false" />
			</h:form>
		</p:panel>
	</ui:define>

</ui:composition>